package com.symria.server.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Formula;

/**
 * AdPush entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "AD_PUSH")
public class AdPush implements java.io.Serializable {

	// Fields

	private Integer adId;
	private Double price;
	private Integer level;
	private String state;
	private String adName;

	// Constructors

	/** default constructor */
	public AdPush() {
	}

	/** minimal constructor */
	public AdPush(Integer adId) {
		this.adId = adId;
	}

	/** full constructor */
	public AdPush(Integer adId, Double price, Integer level, String state) {
		this.adId = adId;
		this.price = price;
		this.level = level;
		this.state = state;
	}

	// Property accessors
	@Id
	@Column(name = "AD_ID", unique = true, nullable = false)
	public Integer getAdId() {
		return this.adId;
	}

	public void setAdId(Integer adId) {
		this.adId = adId;
	}

	@Column(name = "PRICE", precision = 16, scale = 4)
	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@Column(name = "LEVEL")
	public Integer getLevel() {
		return this.level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	@Column(name = "STATE", length = 1)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Formula("(SELECT ac.AD_NAME FROM AD_CAMPAIGN ac WHERE ac.AD_ID=AD_ID)")
	public String getAdName() {
		return adName;
	}

	public void setAdName(String adName) {
		this.adName = adName;
	}

	
}